#ifndef TEXTURECACHE_H_
#define TEXTURECACHE_H_

#include <string>
#include <map>

#include "Texture.h"
#include "Color.h"
#include "Size.h"

class TextureCache
{
public:
    virtual ~TextureCache();
    static void clear();

    static void put(const std::string& key, Texture* texture);
    static Texture* get(const std::string& key);
    static bool has(const std::string& key);

    static std::string keyFromColor(const Color& color);
    static std::string keySizeColor(const Size& size);

private:
    TextureCache();
    typedef std::map<std::string, Texture*> TextureMap;
    static TextureMap cache;
};

#endif
